/*
 * Drone for attacking
 */

package item.drone;

import java.io.Serializable;

import item.ship.Ship;
import item.ship.resource.BasicCorvette;
import item.weapon.Weapon;

public class AttackDrone extends Drone implements Serializable {
	
	private static final long serialVersionUID = 788516830876349405L;
	
	public Weapon weapon; // weapon the drone uses

	protected AttackDrone(int cost, int level, int weight) {
		super(cost, 100, level, weight);
	}
	
	public String toString() {
		return super.toString() + weapon;
	}
	
	//the drone fires on another ship
	
	public void attack(Ship ship) {
		new BasicCorvette().attack(weapon, ship);
	}//end of method attack
	
	//adds a weapon to the ship
	//if the ship already has a weapon, nothing happens

	public void equip(Weapon weapon) {
		if(this.weapon != null)
			return;
		this.weapon = weapon;
	}
	
	//removes weapon from drone
	
	public Weapon dequip() {
		Weapon temp = weapon;
		weapon = null;
		return temp;
	}//end of method dequip
	
	//an attack drone attacks the target ship

	public void action(Ship ship) {
		attack(ship);
	}//end of method action

}//end of class AttackDrone
